﻿using System;
using System.Collections.Specialized;



class Eratosthenes
{
    static void Main(string[] args)
    {
        //创建1-100的数组
        List<int> list = new List<int>();
        for (int i = 1; i <= 100; i++)
        {
            list.Add(i);
        }
        //埃式筛法
        for(int i = 2; i <= list.Count/2; i++)
        {
            int j = list.Count - 1;
            while(j >= 2)
            {
                if(list[j] % i == 0 && list[j]!= i) list.RemoveAt(j);
                j--;
            }
            
        }
        //去除1
        list.RemoveAt(0);

        for (int j = 0; j < list.Count; j++)
            Console.Write(list[j]+" ");
    }

    
}

